<%@page pageEncoding="UTF-8"%><%@ taglib prefix="s" uri="/struts-tags"%>
<s:if test="hasActionErrors() || hasFieldErrors()">
	<script language="javascript" type="text/javascript">
	window.onload=function(){
	var errormessage ="";
	var index = 0;
	<s:iterator value="actionErrors">
		index++;
		<s:if test="getText(top)!=null" >
			errormessage +=index+":<s:property value="getText(top)"/>"+"\n";
		 </s:if>
		 <s:else>
		 	errormessage +=index+":<s:property value="top"/>"+"\n";
		 </s:else>
	</s:iterator>
	if(errormessage!="")
		alert(errormessage);
	}
</script>
</s:if>